# --2022.01.14
# --linjinting


function reset_server(){
    if [ -f /bin/systemctl ]; then
        echo "now stop and remove server"
        systemctl stop vncserver.service
        systemctl disable vncserver.service
        echo "now remove vncserver.service to /etc/systemd/system"
        rm -rf /etc/systemd/system/vncserver.service
        echo "now reload systemd service"
        systemctl daemon-reload

    elif [ -f /bin/chkconfig ]; then
        echo "now stop server"
        service vnc stop
        echo "now del vnc server"
        chkconfig vnc off
        echo "now remove start_vnc.sh "
        rm -rf /etc/init.d/vnc

    else
        echo ".......not support............."
        exit 0
    fi
}

reset_server